export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "仪表编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "仪表名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_equipmentType",
          title: {
            "zh-CN": "类别名称",
            "en-US": "equipment type",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
          config: {
            type: "select",
            options: this.filterEquipTypeOptions,
            disabled: true,
          },
          render: (h, params) => {
            return h(
              "div",
              {},
              this.getOptionValue(
                this.filterEquipTypeOptions,
                params.row.sf_equipmentType
              )
            );
          },
        },
        {
          key: "initValue",
          title: {
            "zh-CN": "初始数值",
            "en-US": "initValue",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "installTime",
          title: {
            "zh-CN": "安装时间",
            "en-US": "installTime",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "thisMonthEstimateNum",
          title: {
            "zh-CN": "本月暂估值",
            "en-US": "thisMonthEstimateNum",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "upperLimitValue",
          title: {
            "zh-CN": "仪表上限值",
            "en-US": "upperLimitValue",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "workshop",
          title: {
            "zh-CN": "责任车间名称",
            "en-US": "workshop",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "procedure",
          title: {
            "zh-CN": "默认工序",
            "en-US": "procedure",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "purchaseDate",
          title: {
            "zh-CN": "采购日期",
            "en-US": "purchaseDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "arrivalDate",
          title: {
            "zh-CN": "到厂日期",
            "en-US": "arrivalDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "responsible",
          title: {
            "zh-CN": "负责人",
            "en-US": "responsible",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "workHours",
          title: {
            "zh-CN": "标准工时",
            "en-US": "workHours",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "originalStandard",
          title: {
            "zh-CN": "原标准工时",
            "en-US": "originalStandard",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "specifyDate",
          title: {
            "zh-CN": "指定日期",
            "en-US": "specifyDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "endDate",
          title: {
            "zh-CN": "结束日期",
            "en-US": "endDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "maintenancePeriod",
          title: {
            "zh-CN": "保养周期",
            "en-US": "maintenancePeriod",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "lastMaintainDate",
          title: {
            "zh-CN": "最近保养周期",
            "en-US": "lastMaintainDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "nextMaintainDate",
          title: {
            "zh-CN": "下次保养周期",
            "en-US": "nextMaintainDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "pointCheckPeriod",
          title: {
            "zh-CN": "点检周期",
            "en-US": "pointCheckPeriod",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "equipmentPower",
          title: {
            "zh-CN": "设备功率",
            "en-US": "equipmentPower",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "createdBy",
          title: {
            "zh-CN": "创建人账号",
            "en-US": "created by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "createTime",
          title: {
            "zh-CN": "创建时间",
            "en-US": "create time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updatedBy",
          title: {
            "zh-CN": "修改人账号",
            "en-US": "updated by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updateTime",
          title: {
            "zh-CN": "修改时间",
            "en-US": "update time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "仪表编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "仪表名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_equipmentType",
          title: {
            "zh-CN": "类别名称",
            "en-US": "equipment type",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.filterEquipTypeOptions },
        },
        {
          key: "initValue",
          title: {
            "zh-CN": "初始数值",
            "en-US": "initValue",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "installTime",
          title: {
            "zh-CN": "安装时间",
            "en-US": "installTime",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
        {
          key: "upperLimitValue",
          title: {
            "zh-CN": "仪表上限值",
            "en-US": "upperLimitValue",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "workshop",
          title: {
            "zh-CN": "责任车间名称",
            "en-US": "workshop",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "procedure",
          title: {
            "zh-CN": "默认工序",
            "en-US": "procedure",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "purchaseDate",
          title: {
            "zh-CN": "采购日期",
            "en-US": "purchaseDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "arrivalDate",
          title: {
            "zh-CN": "到厂日期",
            "en-US": "arrivalDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "responsible",
          title: {
            "zh-CN": "负责人",
            "en-US": "responsible",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "workHours",
          title: {
            "zh-CN": "标准工时",
            "en-US": "workHours",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "originalStandard",
          title: {
            "zh-CN": "原标准工时",
            "en-US": "originalStandard",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "specifyDate",
          title: {
            "zh-CN": "指定日期",
            "en-US": "specifyDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "endDate",
          title: {
            "zh-CN": "结束日期",
            "en-US": "endDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "maintenancePeriod",
          title: {
            "zh-CN": "保养周期",
            "en-US": "maintenancePeriod",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "lastMaintainDate",
          title: {
            "zh-CN": "最近保养周期",
            "en-US": "lastMaintainDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "nextMaintainDate",
          title: {
            "zh-CN": "下次保养周期",
            "en-US": "nextMaintainDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "pointCheckPeriod",
          title: {
            "zh-CN": "点检周期",
            "en-US": "pointCheckPeriod",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "equipmentPower",
          title: {
            "zh-CN": "设备功率",
            "en-US": "equipmentPower",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "仪表编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "仪表名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "仪表编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "仪表名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    // 绑定选择项查询字段
    selectFormColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "仪表编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "仪表名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
        },
      ];
    },
    // 绑定选择项列字段
    selectColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "仪表编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "仪表名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
      ];
    },
    // 绑定选择项列表更多字段
    selectMormColumns() {
      return {
        type: "expand",
        slot: "expand",
        width: 40,
        render: (h, params) => {
          return h("div", [
            h("div", `${this.lang["remark"]}:${params.row.remark}`),
          ]);
        },
      };
    },
  },
};
